3.45 \(\int \frac{\sin (x)}{a+b \csc (x)} \, dx\)

Optimal. Leaf size=61 \[ -\frac{2 b^2 \tanh ^{-1}\left (\frac{a+b \tan \left (\frac{x}{2}\right )}{\sqrt{a^2-b^2}}\right )}{a^2 \sqrt{a^2-b^2}}-\frac{b x}{a^2}-\frac{\cos (x)}{a} \]

[Out]

-((b*x)/a^2) - (2*b^2*ArcTanh[(a + b*Tan[x/2])/Sqrt[a^2 - b^2]])/(a^2*Sqrt[a^2 - b^2]) - Cos[x]/a

________________________________________________________________________________________

Rubi [A]  time = 0.106608, antiderivative size = 61, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 6, integrand size = 11, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.546, Rules used = {3853, 12, 3783, 2660, 618, 206} \[ -\frac{2 b^2 \tanh ^{-1}\left (\frac{a+b \tan \left (\frac{x}{2}\right )}{\sqrt{a^2-b^2}}\right )}{a^2 \sqrt{a^2-b^2}}-\frac{b x}{a^2}-\frac{\cos (x)}{a} \]

Antiderivative was successfully verified.

[In]

Int[Sin[x]/(a + b*Csc[x]),x]

[Out]

-((b*x)/a^2) - (2*b^2*ArcTanh[(a + b*Tan[x/2])/Sqrt[a^2 - b^2]])/(a^2*Sqrt[a^2 - b^2]) - Cos[x]/a

Rule 3853

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_)/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Simp[(Cot[e + f*
x]*(d*Csc[e + f*x])^n)/(a*f*n), x] - Dist[1/(a*d*n), Int[((d*Csc[e + f*x])^(n + 1)*Simp[b*n - a*(n + 1)*Csc[e
+ f*x] - b*(n + 1)*Csc[e + f*x]^2, x])/(a + b*Csc[e + f*x]), x], x] /; FreeQ[{a, b, d, e, f}, x] && NeQ[a^2 -
b^2, 0] && LeQ[n, -1] && IntegerQ[2*n]

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 3783

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(-1), x_Symbol] :> Simp[x/a, x] - Dist[1/a, Int[1/(1 + (a*Sin[c + d
*x])/b), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 - b^2, 0]

Rule 2660

Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{e = FreeFactors[Tan[(c + d*x)/2], x]}, Dis
t[(2*e)/d, Subst[Int[1/(a + 2*b*e*x + a*e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}, x] &&
 NeQ[a^2 - b^2, 0]

Rule 618

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Dist[-2, Subst[Int[1/Simp[b^2 - 4*a*c - x^2, x], x]
, x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rubi steps

\begin{align*} \int \frac{\sin (x)}{a+b \csc (x)} \, dx &=-\frac{\cos (x)}{a}-\frac{\int \frac{b}{a+b \csc (x)} \, dx}{a}\\ &=-\frac{\cos (x)}{a}-\frac{b \int \frac{1}{a+b \csc (x)} \, dx}{a}\\ &=-\frac{b x}{a^2}-\frac{\cos (x)}{a}+\frac{b \int \frac{1}{1+\frac{a \sin (x)}{b}} \, dx}{a^2}\\ &=-\frac{b x}{a^2}-\frac{\cos (x)}{a}+\frac{(2 b) \operatorname{Subst}\left (\int \frac{1}{1+\frac{2 a x}{b}+x^2} \, dx,x,\tan \left (\frac{x}{2}\right )\right )}{a^2}\\ &=-\frac{b x}{a^2}-\frac{\cos (x)}{a}-\frac{(4 b) \operatorname{Subst}\left (\int \frac{1}{-4 \left (1-\frac{a^2}{b^2}\right )-x^2} \, dx,x,\frac{2 a}{b}+2 \tan \left (\frac{x}{2}\right )\right )}{a^2}\\ &=-\frac{b x}{a^2}-\frac{2 b^2 \tanh ^{-1}\left (\frac{b \left (\frac{a}{b}+\tan \left (\frac{x}{2}\right )\right )}{\sqrt{a^2-b^2}}\right )}{a^2 \sqrt{a^2-b^2}}-\frac{\cos (x)}{a}\\ \end{align*}

Mathematica [A]  time = 0.0985496, size = 56, normalized size = 0.92 \[ -\frac{-\frac{2 b^2 \tan ^{-1}\left (\frac{a+b \tan \left (\frac{x}{2}\right )}{\sqrt{b^2-a^2}}\right )}{\sqrt{b^2-a^2}}+a \cos (x)+b x}{a^2} \]

Antiderivative was successfully verified.

[In]

Integrate[Sin[x]/(a + b*Csc[x]),x]

[Out]

-((b*x - (2*b^2*ArcTan[(a + b*Tan[x/2])/Sqrt[-a^2 + b^2]])/Sqrt[-a^2 + b^2] + a*Cos[x])/a^2)

________________________________________________________________________________________

Maple [A]  time = 0.061, size = 72, normalized size = 1.2 \begin{align*} -2\,{\frac{1}{a \left ( \left ( \tan \left ( x/2 \right ) \right ) ^{2}+1 \right ) }}-2\,{\frac{b\arctan \left ( \tan \left ( x/2 \right ) \right ) }{{a}^{2}}}+2\,{\frac{{b}^{2}}{{a}^{2}\sqrt{-{a}^{2}+{b}^{2}}}\arctan \left ( 1/2\,{\frac{2\,b\tan \left ( x/2 \right ) +2\,a}{\sqrt{-{a}^{2}+{b}^{2}}}} \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sin(x)/(a+b*csc(x)),x)

[Out]

-2/a/(tan(1/2*x)^2+1)-2/a^2*b*arctan(tan(1/2*x))+2*b^2/a^2/(-a^2+b^2)^(1/2)*arctan(1/2*(2*b*tan(1/2*x)+2*a)/(-
a^2+b^2)^(1/2))

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)/(a+b*csc(x)),x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [A]  time = 0.531966, size = 520, normalized size = 8.52 \begin{align*} \left [\frac{\sqrt{a^{2} - b^{2}} b^{2} \log \left (-\frac{{\left (a^{2} - 2 \, b^{2}\right )} \cos \left (x\right )^{2} + 2 \, a b \sin \left (x\right ) + a^{2} + b^{2} - 2 \,{\left (b \cos \left (x\right ) \sin \left (x\right ) + a \cos \left (x\right )\right )} \sqrt{a^{2} - b^{2}}}{a^{2} \cos \left (x\right )^{2} - 2 \, a b \sin \left (x\right ) - a^{2} - b^{2}}\right ) - 2 \,{\left (a^{2} b - b^{3}\right )} x - 2 \,{\left (a^{3} - a b^{2}\right )} \cos \left (x\right )}{2 \,{\left (a^{4} - a^{2} b^{2}\right )}}, -\frac{\sqrt{-a^{2} + b^{2}} b^{2} \arctan \left (-\frac{\sqrt{-a^{2} + b^{2}}{\left (b \sin \left (x\right ) + a\right )}}{{\left (a^{2} - b^{2}\right )} \cos \left (x\right )}\right ) +{\left (a^{2} b - b^{3}\right )} x +{\left (a^{3} - a b^{2}\right )} \cos \left (x\right )}{a^{4} - a^{2} b^{2}}\right ] \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)/(a+b*csc(x)),x, algorithm="fricas")

[Out]

[1/2*(sqrt(a^2 - b^2)*b^2*log(-((a^2 - 2*b^2)*cos(x)^2 + 2*a*b*sin(x) + a^2 + b^2 - 2*(b*cos(x)*sin(x) + a*cos
(x))*sqrt(a^2 - b^2))/(a^2*cos(x)^2 - 2*a*b*sin(x) - a^2 - b^2)) - 2*(a^2*b - b^3)*x - 2*(a^3 - a*b^2)*cos(x))
/(a^4 - a^2*b^2), -(sqrt(-a^2 + b^2)*b^2*arctan(-sqrt(-a^2 + b^2)*(b*sin(x) + a)/((a^2 - b^2)*cos(x))) + (a^2*
b - b^3)*x + (a^3 - a*b^2)*cos(x))/(a^4 - a^2*b^2)]

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\sin{\left (x \right )}}{a + b \csc{\left (x \right )}}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)/(a+b*csc(x)),x)

[Out]

Integral(sin(x)/(a + b*csc(x)), x)

________________________________________________________________________________________

Giac [A]  time = 1.45592, size = 104, normalized size = 1.7 \begin{align*} \frac{2 \,{\left (\pi \left \lfloor \frac{x}{2 \, \pi } + \frac{1}{2} \right \rfloor \mathrm{sgn}\left (b\right ) + \arctan \left (\frac{b \tan \left (\frac{1}{2} \, x\right ) + a}{\sqrt{-a^{2} + b^{2}}}\right )\right )} b^{2}}{\sqrt{-a^{2} + b^{2}} a^{2}} - \frac{b x}{a^{2}} - \frac{2}{{\left (\tan \left (\frac{1}{2} \, x\right )^{2} + 1\right )} a} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)/(a+b*csc(x)),x, algorithm="giac")

[Out]

2*(pi*floor(1/2*x/pi + 1/2)*sgn(b) + arctan((b*tan(1/2*x) + a)/sqrt(-a^2 + b^2)))*b^2/(sqrt(-a^2 + b^2)*a^2) -
 b*x/a^2 - 2/((tan(1/2*x)^2 + 1)*a)